<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      <h1>{{msg}}</h1>

      <!-- 第二种 使用组件  推荐使用 vue  -->
      <home></home>

      <!-- 单标签使用 -->
      <home />

     
    </div>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <script>
      //第一步注册组件
      Vue.component("home",{
        data() {
          return {
            list:['前端东西太多','哈哈','嘎嘎','嘿嘿','嘻嘻']
          }
        },
        template:
        `<div>
           <ul>
            <li v-for='(item,index) in list'>
              {{item}}
            </li>
          </ul>
        </div>`,

      })
      var vm = new Vue({
        el: "#app",
        data: {
          msg: "vue",
        },
        methods: {},
      });
    </script>
  </body>
</html>
